package com.cn.icss.service.impl;

import com.cn.icss.service.ICommentService;
import com.cn.icss.vo.CommentInfo;
import com.jfinal.plugin.activerecord.Page;

import java.util.List;

/**
 * @中软华腾软件系统有限公司,未经授权不得擅自传播
 * @类描述:
 * @类名称:CommentServiceImpl
 * @作者: Administrator
 * @编辑时间: 2020/05/12 16:01
 * @版本: 1.0
 */
public class CommentServiceImpl implements ICommentService {

    private CommentInfo commentInfoDao = new CommentInfo().dao();

    @Override
    public boolean saveComment(CommentInfo commentInfo) {

        return commentInfo.save();
    }

    @Override
    public Page<CommentInfo> findCommentSplit(String targetId, int page, int limit) {

        return commentInfoDao.paginate(page, limit, "SELECT * ", "FROM comment_info WHERE targetId = ? ORDER BY createTime DESC ", targetId);

    }
}
